home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Developer / CIncludesTool 1.0 / ¡¡¡ Read Me !!!
Encoding:
Text File  |  1994-02-28  |  5.9 KB  |  115 lines  |  [TEXT/R*ch]

  1. Read-Me file for CIncludes tools and scripts.
  2.  
  3. This archive contains some MPW and ToolServer scripts and tools that are useful
  4. for finding C function definitions, etc. in your standard header files.
  5.  
  6. Two versions are included. The original was obtained from CompuServe a number of
  7. years ago. It was very useful, but had some limitations (no provision for
  8. switching from the header files and definitions  for one compiler to another,
  9. the include files were expected to all be in a single folder, etc.)
  10.  
  11. I modified the original tool (slightly) and script (much more extensively) to
  12. deal with these issues. There is an environment variable defined
  13. {CIncludesCompiler} which defines which compiler is currently in use, and
  14. therefore what search path should be used when locating header files. The
  15. included scripts have support for the Apple C and C++ compilers, the Symantec
  16. MPW compilers, and the Metrowerks CodeWarrior compilers. The first two come with
  17. a standard set of scripts which define environment variables for normal and
  18. MacApp header files. These same environment variables are used by my scripts.
  19. Since the Metrowerks compilers aren't MPW tools, they don't come with any
  20. scripts. I have supplied two scripts (UserStartup•MW and UserStartupTS•MW) to
  21. define comparable environment variables. These scripts should be edited to
  22. reflect the correct file path to the headers on your drive.
  23.  
  24. Please read the file "Instructions" which accompanies the original version of the
  25. scripts and tool for information on what services are provided. The following
  26. notes are not intended to be exhaustive or complete.
  27.  
  28. Included are scripts for using the CIncludesCode tool with BBEdit, ObjectMaster,
  29. and Metrowerks CodeWarrior. These editors use different commands to support
  30. opening files from within ToolServer, so the supporting scripts have been
  31. modified appropriately. In the MPW shell, the main script is named
  32. CIncludesTool. In BBEdit it's called BBEdit•CIncludesTool. For ObjectMaster,
  33. it's OMCincludesTool. For CodeWarrior, it's MWCIncludesTool.
  34.  
  35. After installing the scripts and tools (making any modifications to search paths,
  36. etc. required by your system), the first step is to generate the data files (1
  37. per compiler) used by the tools and scripts. In MPW the command:
  38.  
  39. CIncludesTool -m
  40.  
  41. will generate the file (which can be very time consuming). Note that if this is
  42. performed using ToolServer (in ObjectMaster, BBEdit, Metrowerks, etc.) there is
  43. very little feedback about the status of the operation. Be patient: it takes a
  44. long time to parse 100+ header files. The data file is automatically put in the
  45. preferences folder within the system folder.
  46.  
  47. Once the data file has been made, the other 3 functions can be tried. The
  48. commands are:
  49.  
  50. CIncludesTool -i
  51.     when this is invoked via menu, with selected #include <headername.h> text,
  52.     the selected #includes are reformatted to remove redundancies
  53.     
  54. CIncludesTool -f
  55.     when this is invoked via menu, with selected text, a line of the form:
  56.  #include <headername.h>
  57.     is added to the file's current list of #includes, where headername.h is the
  58.     file which contains the definition of the selected text. Note that the
  59.     command doesn't check for duplicates, so <headername.h> may already be
  60.     present.
  61.     
  62. CIncludesTool -d
  63.     when this is invoked via menu, with selected text, the header file
  64.     containing the definition of the selected text is opened, with the definition
  65.     selected.
  66.      
  67. The MPW Shell supports all 3 operations, as it has a flexible, scriptable Find
  68. command. Under BBEdit, ObjectMaster, and Metrowerks, only the last two are
  69. available. Also, rather than adding the  #include <headername.h> for the
  70. CIncludesTool -f command (which can't easily be done owing to limited scripting
  71. ability), either an alert with the name of the header file is displayed, or the
  72. #include <headername.h> is written to the worksheet. Also, only ObjectMaster
  73. supports getting the current selection, so the BBEdit and Metrowerks scripts
  74. have been modified to take an extra parameter (the definition to be searched
  75. for).
  76.  
  77. In BBEdit, it is useful to place aliases to the BBEdit•FindCIncludes,
  78. BBEdit•OpenCIncludes, and BBEdit•RebuildCIncludes in BBEdit's ToolServer Tools
  79. folder. The first two alias files should be renamed to end in ellipsis (…), so
  80. BBEDit can present a dialog prompting for the command arguments. If the
  81. definition you wish to look up is already selected when choosing one of these
  82. commands from the BBEdit ToolServer menu, the selected text will be added by
  83. default to the dialog. Hitting the Run button will then execute the script
  84. correctly.
  85.  
  86. Unfortunately, this same functionality is not available in the current (1.0a1)
  87. version of Metrowerks CodeWarrior. The only way to use these scripts and tools
  88. in this environment is by entering commands directly in the worksheet window,
  89. such as:
  90.  
  91. MWCIncludesTool -d FSOpen  # open the file containing the definition of FSOpen
  92.  
  93. The SetCompiler script is used to change the current value of the
  94. {CIncludesCompiler} environment variable. It has Commando support. Note that in
  95. order for this change to be visible outside the script, it must be executed
  96. rather than run normally. This is possible in the MPW Shell and ObjectMaster
  97. environments, and the included startup scripts install menu items for doing
  98. this. Neither BBEdit or Metrowerks support execution in this manner. To change
  99. the compiler value in these cases, simply enter the appropriate command in the
  100. worksheet window:
  101.  
  102. Set CIncludesCompiler AppleCFront        # when using the Apple compilers
  103. Set CIncludesCompiler 'SymantecC++'        # when using the Symantec MPW compilers
  104. Set CIncludesCompiler 'MetrowerksC++'    # when using the Metrowerks compilers
  105.  
  106. ••••••••••••••••••••••••••
  107.  
  108. IMPORTANT. The source code and scripts are copyrighted by the original author,
  109. who released them for non-profit use by individuals. I attach no additional
  110. restrictions to my modifications, and I accept no responsibility or liability
  111. for your use of any of the enclosed files.
  112.  
  113. Brian Clark
  114. b-clark@nwu.edu
  115.